import request from '@/utils/request'
// 申请所需特殊材料 API接口
const std_matter_attach_specialApi = {
  list: '/std_matter_attach_special/list',
  save: '/std_matter_attach_special/save',
  view: '/std_matter_attach_special/view',
  del: '/std_matter_attach_special/delete',
  dels: '/std_matter_attach_special/batchDel',
  output: '/std_matter_attach_special/output',
  exportExcelTemplate: '/std_matter_attach_special/exportExcelTemplate',
  importExcel: '/std_matter_attach_special/importExcel',
  saveAll: '/std_matter_attach_special/saveAll',
  queryListByMatid: '/std_matter_attach_special/queryListByMatid'
}

/**
 * 导入申请所需特殊材料Excel
 */
export function importExcel(data) {
  var body = new FormData()
  body.append('file', data)
  return request({
    url: std_matter_attach_specialApi.importExcel,
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data: body
  })
}

/**
 * 导出申请所需特殊材料Excel模板
 */
export function exportExcelTemplate() {
  return request({
    url: std_matter_attach_specialApi.exportExcelTemplate,
    method: 'post',
    responseType: 'blob'
  })
}

/**
 * 导出申请所需特殊材料
 */
export function output(data) {
  return request({
    url: std_matter_attach_specialApi.output,
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
/**
 * 批量删除申请所需特殊材料
 * @param {*} ids
 */
export function delStd_matter_attach_specials(ids) {
  return request({
    url: std_matter_attach_specialApi.dels,
    method: 'post',
    params: { ids }
  })
}
/**
 * 删除申请所需特殊材料
 * @param {*} id
 */
export function delStd_matter_attach_special(id) {
  return request({
    url: std_matter_attach_specialApi.del,
    method: 'post',
    params: { id }
  })
}
/**
 * 查看、编辑申请所需特殊材料
 * @param {*} id
 */
export function viewStd_matter_attach_special(id) {
  return request({
    url: std_matter_attach_specialApi.view,
    method: 'get',
    params: { id }
  })
}
/**
 * 保存申请所需特殊材料
 * @param {*} body
 */
export function saveStd_matter_attach_special(body) {
  return request({
    url: std_matter_attach_specialApi.save,
    method: 'post',
    data: body
  })
}
/**
 * 查询申请所需特殊材料列表
 * @param {*} body
 */
export function queryStd_matter_attach_specialList(body) {
  return request({
    url: std_matter_attach_specialApi.list,
    method: 'post',
    data: body
  })
}

/**
 * 批量保存申请所需特殊材料
 * @param {*} body
 */
export function saveStd_matter_attach_specialAll(body) {
  return request({
    url: std_matter_attach_specialApi.saveAll,
    method: 'post',
    data: body
  })
}

/**
 * 根据事项id获取特殊申请材料列表定义
 * @param {*} parameter
 * @returns
 */
export function queryStdMatterAttachSpecialListByMatid(parameter) {
  return request({
    url: std_matter_attach_specialApi.queryListByMatid,
    method: 'get',
    params: parameter
  })
}
